package com.easygoods.request;

import com.bestvike.stone.spring.exception.AssertUtils;
import com.bestvike.stone.spring.rest.IRequest;
import lombok.Data;

/**
 * Created by 许崇雷 on 2019-04-02.
 */
@Data
public class ChangeMobileBySmsRequest implements IRequest {
    private String verifyCode;
    private String newMobile;

    @Override
    public void assertValid() {
        AssertUtils.hasText(this.verifyCode, "verifyCode");
        AssertUtils.hasText(this.newMobile, "newMobile");
        AssertUtils.isTrue(this.newMobile.length() == 11, "手机号必须为 11 位");
    }
}
